/*
 */

package com.jams.goodox.net.services;

import com.jams.goodox.constant.UrlConstants;
import com.jams.goodox.entity.StringBean;
import com.jams.goodox.net.BaseEntity;
import com.jams.goodox.tinker.TinkerUamaBean;

import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 *
 * Created by 二更 on 2016/5/17.
 */
public interface LoginService {
    String TYPE_REGiST_SEND_REGISTER = "4";//获取短信验证码，发送用户类型为注册
    String TYPE_FORGET_SEND_REGISTER = "1";//忘记密码

    //首页
    @POST("api/home/index")
    Call<ResponseBody> homeInfo( @Body RequestBody body);

    //注册
    @POST("api/member/register")
    Call<ResponseBody> registerUser( @Body RequestBody body);

    //手机是否注册
    @POST("api/member/isExist")
    Call<ResponseBody> isRegisterUser( @Body RequestBody body);


    //发送短信码
    @POST("api/sms/send")
    Call<ResponseBody> getSmsCode( @Body RequestBody body);


    //登录
    @POST("api/authen/login")
    Call<ResponseBody> login(@Body RequestBody body);


    //证件信息上传
    @Multipart
    @POST("api/member/upload")
    Call<ResponseBody> upload(@PartMap() Map<String, RequestBody> partMap,
                              @Part MultipartBody.Part files);


    //用户信息更新
    @Multipart
    @POST("api/member/update")
    Call<ResponseBody> updataMemberInfo(@PartMap() Map<String, RequestBody> partMap,
                                        @Part MultipartBody.Part files);


    //重置密码
    @POST("api/member/resetPwd")
    Call<ResponseBody> resetPwd(@Body RequestBody body);

    //修改密码
    @POST("api/member/editPwd")
    Call<ResponseBody> editPwd(@Body RequestBody body);


    //问答tab
    @POST("api/question/teacher")
    Call<ResponseBody> teacherQA(@Body RequestBody body);
    //10.	教师问答—未回答接口
    @POST("api/question/teacherAsk")
    Call<ResponseBody> teacherAsk(@Body RequestBody body);
    //11.	教师问答—已回答接口
    @POST("api/question/teacherAnswered")
    Call<ResponseBody> teacherAnswered(@Body RequestBody body);




    //我的问答
    @POST("api/question/own")
    Call<ResponseBody> own(@Body RequestBody body);
    //未回答接口
    @POST("api/question/ownAsk")
    Call<ResponseBody> ownAsk(@Body RequestBody body);
    //已回答接口
    @POST("api/question/ownAnswered")
    Call<ResponseBody> ownAnswered(@Body RequestBody body);


    //获取教师列表
    @POST("api/teacher/list")
    Call<ResponseBody> tacherList(@Body RequestBody body);

    //教师主页
    @POST("api/teacher/home")
    Call<ResponseBody> tacherHome(@Body RequestBody body);

    //13.	教师主页已回答问题
    @POST("api/question/teacherPublic")
    Call<ResponseBody> teacherPublic(@Body RequestBody body);


    //	问题精选
    @POST("api/question/choice")
    Call<ResponseBody> questionChoice(@Body RequestBody body);

    //	15.	名师推荐
    @POST("api/teacher/recommend")
    Call<ResponseBody> teacherrRecommend(@Body RequestBody body);

   //家长提问
    @Multipart
    @POST("api/question/add")
    Call<ResponseBody> addQuestion(@PartMap() Map<String, RequestBody> partMap,
                                        @Part MultipartBody.Part files);

    //获取课堂列表
    @POST("api/course/index")
    Call<ResponseBody> courseIndex(@Body RequestBody body);

    //课堂搜索
    @POST("api/course/search")
    Call<ResponseBody> courseSearch(@Body RequestBody body);

    //课堂详情
    @POST("api/course/detail")
    Call<ResponseBody> courseDetail(@Body RequestBody body);


    @POST("api/course/buy")
    Call<ResponseBody> buyOrder(@Body RequestBody body);

    @POST("api/coin/pay")
    Call<ResponseBody> payOrder(@Body RequestBody body);


    //购买问题答案
    @POST("api/coin/payAnswer")
    Call<ResponseBody> payAnswer(@Body RequestBody body);

    //课程简介接口
    @POST("api/course/introduce")
    Call<ResponseBody> courseIntroduce(@Body RequestBody body);

    //点赞
    @POST("api/like/add")
    Call<ResponseBody> thumbUp(@Body RequestBody body);

    //添加评论接口
    @POST("api/comment/add")
    Call<ResponseBody> addComment(@Body RequestBody body);

    // 课程评论列表接口
    @POST("api/comment/list")
    Call<ResponseBody> listComment(@Body RequestBody body);

    @Streaming
    @GET
    Call<ResponseBody> downloadFileWithDynamicUrlSync(@Url String fileUrl);


    // 查询课程系列
    @POST("api/series/list")
    Call<ResponseBody> getCourseSerious(@Body RequestBody body);

    // add课程系列
    @POST("api/series/add")
    Call<ResponseBody> addCourseSerious(@Body RequestBody body);

    // update课程系列
    @POST("api/series/update")
    Call<ResponseBody> updateCourseSerious(@Body RequestBody body);

    //问题详情
    @POST("api/question/detail")
    Call<ResponseBody> questionDetail(@Body RequestBody body);

    //教师回答问题
    @Multipart
    @POST("api/answer/add")
    Call<ResponseBody> addAnswer(@PartMap() Map<String, RequestBody> partMap,
                                   @Part MultipartBody.Part files);


    //查看某一系列下的所有课程
    @POST("api/course/series")
    Call<ResponseBody> questionSeries(@Body RequestBody body);

    //问答展示
    @POST("api/answer/show")
    Call<ResponseBody> showAnswer(@Body RequestBody body);



    @POST("api/feedback/add")
    Call<ResponseBody> feedBack(@Body RequestBody body);

//    //获取引导页
//    @GET(Constant.getLaunchImage)
//    Call<LaunchUrlBean> getLaunchImage(@Query("versionId") String versionId);

    //忘记密码
    @PUT(UrlConstants.forgetPasswprd)
    Call<BaseEntity> forgetPasswprd(@QueryMap Map<String, String> names);

    // 请求验证码 类型 1找回密码 2修改用户电话号码 4注册时获取验证码
    @GET(UrlConstants.sendCode)
    Call<BaseEntity> sendCode(@QueryMap Map<String, String> names);


    @GET(UrlConstants.sendCompanyCode)
    Call<StringBean> sendCompanyCode(@QueryMap Map<String, String> names);

    //验证验证码
    @GET(UrlConstants.testVerification)
    Call<BaseEntity> testVerification(@Path("phone") String phone, @Path("verCode") String verCode);

    //退出登陆
    @PUT(UrlConstants.logOut)
    Call<BaseEntity> logOut();

    //获取热修复信息
    @GET(UrlConstants.getTinkerMessage)
    Call<TinkerUamaBean> getTinkerMessage(@Path("tinkerId") String tinkerId);
}
